home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / p_thenet / tn212.exe / TELEM.TXT < prev    next >
Text File  |  1993-08-15  |  6KB  |  164 lines

  1. Telemetry Adapter for the TNC-2
  2.  
  3. By Bill Beech, NJ7P
  4. P.O. Box 38
  5. Sierra Vista, AZ.  85636-0038
  6.  
  7. Jack Taylor, N7OO
  8. RR-2 Box 1640
  9. Sierra Vista, AZ.  85635
  10.  
  11. Abstract
  12.  
  13.     This paper describes a modification for the TNC-2 to 
  14. allow 16 bits of digital I/O and 16 channels of analog to 
  15. digital conversion. 
  16.  
  17. 1.  Background
  18.  
  19.     During the development of the TheNet 2.XX code, the 
  20. need for control and monitoring of remote sites was a 
  21. discussion topic between the authors.  Kantronics had 
  22. marketed the Weather Node and we were asked to provide an 
  23. interface from TheNet to the Weather Node.  The idea that 
  24. there must be a more seamless solution drove the design of 
  25. this adapter.
  26.  
  27. 2.  Design Alternatives
  28.  
  29.     The Weather Node is an 8051 microprocessor based device 
  30. to provide an ASCII interface to read the measured data.  
  31. This design did not lend itself to interfacing with a node 
  32. stack because the node stack uses a modified X.25 frame for 
  33. internode communications on the RS-232 port.  It did not 
  34. provide the control functions necessary to provide remote 
  35. control of the site.  
  36.  
  37.     The design discussed in this paper utilizes an 82C55 
  38. Parallel Interface Adapter (PIA) and an ADC0817 16-channel 
  39. Analog Digital Converter (ADC).  These IC's provide the 
  40. necessary functionality to provide 16 bits of digital I/O, 
  41. which are byte selectable as either input or output, and a 
  42. 16 channel voltmeter with 20 millivolt resolution on the 
  43. basic range of 0 to 5 volts.  They are used in an adapter 
  44. which fits in the TNC-2 and adds this functionality to the 
  45. TNC-2.
  46.  
  47.  
  48.  
  49. 3.  Circuit Description
  50.  
  51.     The adapter (see figure 1) gains its operating power 
  52. and all but one required signal from its connection to the 
  53. Z80 microprocessor.  The adapter plugs into the Z80 socket, 
  54. and the Z80 plugs into the adapter.  
  55.  
  56.     The 74HCT138 provides the address decode for the PIA 
  57. and the ADC.  The 74HCT02 provides the read/write 
  58. qualification for the ADC and inverts the reset signal for 
  59. the PIA.  
  60.  
  61.     The 8 bits of port A and B of the PIA are available for 
  62. control.  The ports can be set independently for input or 
  63. output.  Each bit represent a CMOS load as an input.  Each 
  64. bit can source/sink up to 2 milliamps as an output. 
  65.  
  66.     The lower 4 bits of port C of the PIA are used to 
  67. select the ADC channel for conversion.  The ADC is clocked 
  68. from the 614 KHz signal on pin 5 of U4A in the TNC-2.  (This 
  69. is the only signal not present on the Z80).  The conversion 
  70. time is 100 microseconds.  Each channel can have the basic 
  71. range multiplied by insertion of a single resistor in place 
  72. of the jumpers in the MULT headers, H2 and H3.   
  73.  
  74. 4.  Software
  75.  
  76.     The Telemetry Adapter software was incorporated in the 
  77. TheNet Version 2.10 release.  Since there is no generic 
  78. AX.25 code for the TNC-2 in the public domain, this was the 
  79. only software available for testing.  As the adapter was to 
  80. be used in a node stack, and the authors had experience with 
  81. this code, this was not a problem.  
  82.  
  83.     The software allows reading the digital ports as hex 
  84. bytes.  The ports are written to in a decimal format.  The 
  85. voltmeter data is displayed as fixedpoint (i.e. 1.23).  The 
  86. software will allow integral multipliers of the basic 0 to 5 
  87. volt range (i.e. 0 to 20 volts) to match the multiplier 
  88. resistors used on each channel.  The ADC is switched through 
  89. each channel continuously measuring the values.  The 
  90. software switches channels every 10 milliseconds. 
  91.  
  92.     The following exchange with a telemetry adapter 
  93. equipped TNC-2 demonstrates the telemetry functions (bold 
  94. are user commands, normal are tnc responses):
  95.  
  96.     * c
  97.     CONN to NJ7P-4
  98.     t
  99.     SVATST:NJ7P-4} A=00 B=00
  100.     V0-7  4.99 3.46 2.35 1.62 1.09 0.78 0.50 0.37
  101.     V8-15 0.23 0.17 0.11 0.07 0.05 0.01 0.00 0.00
  102.     t 255 128
  103.     SVATST:NJ7P-4} A=FF B=80
  104.     V0-7  4.99 3.44 2.37 1.60 1.09 0.78 0.50 0.35
  105.     V8-15 0.25 0.15 0.11 0.07 0.03 0.03 0.01 0.00
  106.     t 128 0
  107.     SVATST:NJ7P-4} A=80 B=00
  108.     V0-7  4.99 3.44 2.35 1.62 1.09 0.74 0.50 0.37
  109.     V8-15 0.23 0.17 0.11 0.07 0.03 0.03 0.01 0.00
  110.     t 0 0
  111.     SVATST:NJ7P-4} A=00 B=00
  112.     V0-7  4.99 3.46 2.37 1.62 1.11 0.74 0.52 0.35
  113.     V8-15 0.25 0.15 0.11 0.07 0.03 0.01 0.01 0.00
  114.     b
  115.     DISC from NJ7P-4
  116.  
  117. In this example both digital I/O ports are configured for 
  118. output.  Note that the commands for the bits are in decimal.  
  119. The conversion routine for input uses decimal notation, and 
  120. there is not enough room in the ROM for a hexadecimal 
  121. routine.  The voltages read here are from a resistor ladder 
  122. network consisting of 16 4.7K resistors tying IN0 to IN15 
  123. together.  IN0 is also connected to VCC and IN15 is 
  124. connected to ground.
  125.  
  126. 5.  Applications
  127.  
  128.     The obvious application would be remote monitoring of 
  129. power supply voltages and transmitter forward and reflected 
  130. power.  Power supply and battery voltages could be measured 
  131. by putting a 100K resistor in the multiplier, and setting 
  132. the software multiplier to 4, yielding a voltmeter range of 
  133. 0 to 20 volts with 80 millivolt steps.  RF power output 
  134. could be measured by setting the multiplier and multiplier 
  135. resistor for an appropriate range.  
  136.  
  137.     Applications providing lower voltages could use an 
  138. operational amplifier to bring the range up to that of the 
  139. basic 0 to 5 volts.  This was done with the homemade 
  140. anemometer based on a 99 cent Radio Shack permanent magnet 
  141. motor.  This anemometer provided 0.075 volts at 50 miles per 
  142. hour and was quite linear. 
  143.  
  144. 6.  Conclusions and Future Directions
  145.  
  146.     The adapter has functioned flawlessly for many months.  
  147. There is a lot of work to be done on interfaces for it to 
  148. sense and control the real world.  
  149.  
  150.     The ability to pass the measured values to a remote 
  151. collection station automatically would be nice.  With the 
  152. code constraints, it might be better to have a control node 
  153. query data from various remote sites and inform the system 
  154. operators whenever a problem is detected. 
  155.  
  156. 7.  References
  157.  
  158. Intel, "Peripherals", 1990
  159.  
  160. MFJ ENTERPRISES, "Model MFJ-1270B/1274 Packet Radio Terminal 
  161. Node Controller TNC 2, Rev 3.1", First Edition, 1986
  162.  
  163. National Semiconductor, "Data Acquisition Handbook", 1978
  164.